﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using WebTest.Core.Entities;

namespace WebTest.Infrastructure.Data.Config
{
    public class RoleConfiguration : IEntityTypeConfiguration<Role>
    {
        public void Configure(EntityTypeBuilder<Role> builder)
        {
            builder.Property(b => b.Name)
                .IsRequired()
                .HasMaxLength(50);

            builder.HasIndex(b => b.Name)
                .IsUnique();
        }
    }
}
